#{extends 'frameHome.html' /} #{set title:'IdeaDeleted' /}#{set 'moreStyles'}

<script type="text/javascript">
	$(document).ready(
			function() {
				$('.left, .content input, .content textarea, .content select')
						.focus(function() {
							$(this).parents('.row').addClass("over");
						}).blur(function() {
							$(this).parents('.row').removeClass("over");
						});
			});
</script>



	<script type="text/javascript">
		function createTarget(t) {
			window.open("", t, "width=600,height=550");
			return true;
		}
	</script>



#{/set}

<a href="@{PostingIdea.deleteIdea(idea.id)}"  onclick="return confirm ('Are you sure you want to delete this idea?');" class=" negative button"><span class="trash icon"></span>Delete Idea</a>
	
	
	#{if userIsOrganizer==true}
	#{if idea.hide==true}
	<a href="@{PostingIdea.unhideIdea(idea.id)}" onclick="return confirm ('Are you sure you want to unhide this idea?');"class=" pill button">UnHide Idea</a>
	#{/if}
	#{else}
	<a href="@{PostingIdea.hideIdea(idea.id)}" onclick="return confirm ('Are you sure you want to hide this idea?');"class=" button"><span class="calendar icon"></span>Hide Idea</a>
	#{/else}
	#{/if}
	
	#{if userIsAdmin==true}
	#{if idea.hide==true}
	<a href="@{PostingIdea.unhideIdea(idea.id)}" onclick="return confirm ('Are you sure you want to unhide this idea?');"class=" pill button">UnHide Idea</a>
	#{/if}
	#{else}
	<a href="@{PostingIdea.hideIdea(idea.id)}" onclick="return confirm ('Are you sure you want to hide this idea?');"class=" button"><span class="calendar icon"></span>Hide Idea</a>
	#{/else}
	#{/if}


<div id=content>


<h2>Idea '${idea.title}' Profile</h2>


#{if idea.topic}
<p><b><u>Idea Topic Title:<a href="@{Topics.showTopic(idea.topic.id)}" > ${idea.topic.title}</a></u> </b></p>
<p><b><u>in Entity:<a href="@{Entity.viewEntity(idea.topic.entity.id)}" > ${idea.topic.entity.entityName}
</u></a></b></p> 
<p><b><u>
in Organization: <a href="@{Organizations.showOrganization(idea.topic.entity.organization.id)}" >${idea.topic.entity.organization.name} 
</a></u></b></p> 
#{/if}

#{if idea.entity}
<p><b><u>Idea Entity Name: <a href="@{Entity.viewEntity(idea.entity.id)}" >${idea.entity.entityName}</a></u></b></p>
<p><b><u>in Organization: <a href="@{Organizations.showOrganization(idea.entity.organization.id)}" >${idea.entity.organization.name}</a></u></b></p>
#{/if}

#{if idea.organization}
<p><b><u>Idea Organization Name:<a href="@{Organizations.showOrganization(idea.organization.id)}" >${idea.organization.name}</a>
 </u></b></p>
#{/if}

	<p><u>Idea Title:</u> ${idea.title}
	<p>
	<p><u>Idea Body:</u> ${idea.body}
	<p>
	<p><u>Posted By:</u> ${idea.author.name}
	<p>
	<p><u>Priority:</u> ${idea.priority}
	<p>
	<p><u>Date of Creation:</u> ${idea.postedAt}
	<p>
	
	#{if userIsOrganizer==true}
	<p><u>Status of Idea:</u> 
	#{if idea.hide==true} 
idea is <b>Hidden</b> 

#{/if}
#{else} 

idea is <b>Unhidden</b> 
#{/else}
	#{/if}
	

<!-- 	
	Share Area -->
	
<fieldset>
<legend><b>Share Idea</b></legend>


<!-- AddThis Button BEGIN -->
<div class="addthis_toolbox addthis_default_style addthis_32x32_style">
<a class="addthis_button_preferred_1"></a>
<a class="addthis_button_preferred_2"></a>
<a class="addthis_button_preferred_3"></a>
<a class="addthis_button_preferred_4"></a>
<a class="addthis_button_compact"></a>
<a class="addthis_counter addthis_bubble_style"></a>
</div>
<script type="text/javascript">var addthis_config = {"data_track_clickback":true};</script>
<script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js#pubid=ra-4dc851d465697ec2"></script>
<!-- AddThis Button END -->


<br/>


<form action="@{ShareIdea.shareIdea(idea.id)}" method="Post">
<input class=input placeholder="Enter the name of the community" type = "text" name="communitynamebox" id="communityname">
<input type=submit value="Share Idea">
</form>	




</fieldset>	


<!-- Tag FieldSet -->
	
<fieldset>
<legend><b>Tagging</b></legend>
<u>Tagged In:</u>

#{if idea.tags}
#{list items:idea.tags, as:'tag'}
<ul>
<li><a class=" button" href="@{Tags.ShowTag(tag.id)}">${tag.name} </a><a  class=" button" href="@{Tags.unTagSuccess(tagString,tag.id)}" ><span class="tag icon"></span>UnTag Idea</a>
</a></li></li>
</ul>
#{/list}
#{/if}
#{else}

<b>No Tags !!</b>

#{/else}

<hr>

<u>Available Tags:</u>

#{if tagsIdeaNotTaggedIn}
#{list items:tagsIdeaNotTaggedIn, as:'tag'}
<ul>

<li><a  class=" button" href="@{Tags.ShowTag(tag.id)}">${tag.name} </a><a href="@{Tags.tagSuccess(tagString,tag.id)}" class=" button""><span class="tag icon"></span>Tag Idea</a>
</li>

</ul>
#{/list}
#{/if}
#{else}
<b>No Tags !!</b>
#{/else}

</fieldset>



<u><b>Manage Idea:</b></u> <br></br>

	#{if user!=idea.author}
	#{if isSpammed == false}
	<p class="field">
		<a href="@{PostingIdea.showIdeaSpam(idea.id)}" class="pill button"
			onclick="alert ('The Idea has been marked as spam');">Mark as spam </a>
	</p>
	#{/if} #{else}
	<p class="field">
		<a href="" class="pill button"
			onclick="alert ('This idea is already flagged !');">Mark as spam </a>
	</p>
	#{/else} #{/if}



</b></p>

<br>


		

	

The rating of this idea: ${idea.rate}/5.0
<br>


<form action="@{Rating.rateIdea(idea.id)}"  method="Post">
<input type=submit value="Rate Idea">

<input type="radio" name="rate" value="1">
<input type="radio" name="rate" value="2">
<input type="radio" name="rate" value="3">
<input type="radio" name="rate" value="4">
<input type="radio" name="rate" value="5">

<br>
<br>

</form>

<br>

<a href= "@{PostingIdea.showIdeaAsDuplicate(idea.id)}"  >
  <input type = "checkbox" value = "idea is duplicate"
 	onclick="alert('The Idea has been duplicated');">idea is duplicate </a>
<br>
<form action="@{SearchForIdeas.sendDuplicate()}" method="Get">
This is the id of the idea you are on please don't change it:<input type = "long"  value=${idea.id} name="ideaId" /><br/>
Enter the name of the idea you believe is duplicate to this idea and then press Send Duplicate: <input type = "text" name="duplicate"/>



<br><input type=submit value="Send Duplicate"/></br>

</form>	
</br>




<br></br>
<u><b>Discussion:</b></u> <br></br>

<br>
 <form action= "@{Comments.Post(idea.id)}"   method="Post">
 
         <label for="body0"> Post your comment:</label> 
         <br> 
	   <textarea cols="50" rows="4" name="body" required="true"></textarea>
	    <input class="button" type="submit" value=" Comment">
	     #{ifErrors}
        <p class="error">
            Please enter Your Comment
          </p>
    #{/ifErrors} 
</form>
</br>



	  <div class="Comments">
        <h3>
            ${idea.comments.size() ?: 'no'} 
            comment${idea.comments.size().pluralize()}
        </h3>
        #{list items:idea.comments, as:'comment'}
           <div class=comment>
            
             <div class="comment-body">
                    <div class="about"></div>
                <li>${comment.body} </li> 
                <a href="@{Comments.deleteComment(comment.id,idea.id)}" class="negative button"><span class="cross icon"></span>Delete Comment</a>
                
                </div>
                </div>
                <div class=commentfooter>
                <div class="comment-metadata">
                    <span class="comment-commentator">by ${comment.commentator.name},</span>
                    <span class="comment-date">
                        ${comment.posttime.format('dd MMM yy')}
                    </span>
                </div>
                </div>
                
<br/>
 #{/list}
</div>






</div>
